const initState = {
    type: 'post',
    url: "/",
    responseOne: {
        url: "",
        data: {}
    },
    responseTwo: {
        url: "",
        data: {}
    },
    responseThree: {
        url: "",
        data: {}
    },
    response: {
        url: ""
    }
};

const PROJECT_NAME = "reduxHttp";
// redux状态
export const reduxSet = {
    name: `${PROJECT_NAME}`,
    redux: `${PROJECT_NAME}`
};

export const testOne = `${PROJECT_NAME}/testOne`;
export const testTwo = `${PROJECT_NAME}/testTwo`;
export const testThree = `${PROJECT_NAME}/testThree`;
export default (state = initState, action) => {
    switch (action.type) {
        case testOne:
            console.log(action);
            return {
                ...state,
                responseOne: {
                    ...action
                },
                response: {
                    ...action.data
                }
            };
        case testTwo:
            return {
                ...state,
                responseTwo: {
                    ...action
                },
                response: {
                    ...action.data
                }
            };
        case testThree:
            return {
                ...state,
                responseThree: {
                    ...action
                },
                response: {
                    ...action.data
                }
            };
        default:
            return {
                ...state
            };
    }
};